00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _OGG_H
00018 #define _OGG_H
00019
00020 #ifdef __cplusplus
00021 extern "C" {
00022 #endif
00023
00024 #include <ogg/os_types.h>
00025
00026 typedef struct {
00027 long endbyte;
00028 int endbit;
00029
00030 unsigned char *buffer;
00031 unsigned char *ptr;
00032 long storage;
00033 } oggpack_buffer;
00034
00035
00036
00037 typedef struct {
00038 unsigned char *header;
00039 long header_len;
00040 unsigned char *body;
00041 long body_len;
00042 } ogg_page;
00043
00044
00045
00046
00047 typedef struct {
00048 unsigned char *body_data;
00049 long body_storage;
00050 long body_fill;
00051 long body_returned;
00052
00053
00054 int *lacing_vals;
00055 ogg_int64_t *granule_vals;
00056
00057
00058 long lacing_storage;
00059 long lacing_fill;
00060 long lacing_packet;
00061 long lacing_returned;
00062
00063 unsigned char header[282];
00064 int header_fill;
00065
00066 int e_o_s;
00067
00068 int b_o_s;
00069
00070 long serialno;
00071 long pageno;
00072 ogg_int64_t packetno;
00073
00074
00075
00076
00077 ogg_int64_t granulepos;
00078
00079 } ogg_stream_state;
00080
00081
00082
00083
00084 typedef struct {
00085 unsigned char *packet;
00086 long bytes;
00087 long b_o_s;
00088 long e_o_s;
00089
00090 ogg_int64_t granulepos;
00091
00092 ogg_int64_t packetno;
00093
00094
00095
00096
00097 } ogg_packet;
00098
00099 typedef struct {
00100 unsigned char *data;
00101 int storage;
00102 int fill;
00103 int returned;
00104
00105 int unsynced;
00106 int headerbytes;
00107 int bodybytes;
00108 } ogg_sync_state;
00109
00110
00111
00112 extern void oggpack_writeinit(oggpack_buffer *b);
00113 extern void oggpack_reset(oggpack_buffer *b);
00114 extern void oggpack_writeclear(oggpack_buffer *b);
00115 extern void oggpack_readinit(oggpack_buffer *b,unsigned char *buf,int bytes);
00116 extern void oggpack_write(oggpack_buffer *b,unsigned long value,int bits);
00117 extern long oggpack_look(oggpack_buffer *b,int bits);
00118 extern long oggpack_look_huff(oggpack_buffer *b,int bits);
00119 extern long oggpack_look1(oggpack_buffer *b);
00120 extern void oggpack_adv(oggpack_buffer *b,int bits);
00121 extern int oggpack_adv_huff(oggpack_buffer *b,int bits);
00122 extern void oggpack_adv1(oggpack_buffer *b);
00123 extern long oggpack_read(oggpack_buffer *b,int bits);
00124 extern long oggpack_read1(oggpack_buffer *b);
00125 extern long oggpack_bytes(oggpack_buffer *b);
00126 extern long oggpack_bits(oggpack_buffer *b);
00127 extern unsigned char *oggpack_get_buffer(oggpack_buffer *b);
00128
00129
00130
00131 extern int ogg_stream_packetin(ogg_stream_state *os, ogg_packet *op);
00132 extern int ogg_stream_pageout(ogg_stream_state *os, ogg_page *og);
00133 extern int ogg_stream_flush(ogg_stream_state *os, ogg_page *og);
00134
00135
00136
00137 extern int ogg_sync_init(ogg_sync_state *oy);
00138 extern int ogg_sync_clear(ogg_sync_state *oy);
00139 extern int ogg_sync_reset(ogg_sync_state *oy);
00140 extern int ogg_sync_destroy(ogg_sync_state *oy);
00141
00142 extern char *ogg_sync_buffer(ogg_sync_state *oy, long size);
00143 extern int ogg_sync_wrote(ogg_sync_state *oy, long bytes);
00144 extern long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og);
00145 extern int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og);
00146 extern int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og);
00147 extern int ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op);
00148 extern int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op);
00149
00150
00151
00152 extern int ogg_stream_init(ogg_stream_state *os,int serialno);
00153 extern int ogg_stream_clear(ogg_stream_state *os);
00154 extern int ogg_stream_reset(ogg_stream_state *os);
00155 extern int ogg_stream_destroy(ogg_stream_state *os);
00156 extern int ogg_stream_eos(ogg_stream_state *os);
00157
00158 extern int ogg_page_version(ogg_page *og);
00159 extern int ogg_page_continued(ogg_page *og);
00160 extern int ogg_page_bos(ogg_page *og);
00161 extern int ogg_page_eos(ogg_page *og);
00162 extern ogg_int64_t ogg_page_granulepos(ogg_page *og);
00163 extern int ogg_page_serialno(ogg_page *og);
00164 extern long ogg_page_pageno(ogg_page *og);
00165 extern int ogg_page_packets(ogg_page *og);
00166
00167 extern void ogg_packet_clear(ogg_packet *op);
00168
00169
00170 #ifdef __cplusplus
00171 }
00172 #endif
00173
00174 #endif